﻿<!-- 教材管理-教研室审核 -->
<template>
    <div>
        <!-- 添加按钮 -->
        <div class="btn-add">
            <button type="button" class="btn btn-success btn-lg" @click="dy()"><i class="iconfont icon-chenggong ft12 mr5"></i>打印班级发放清单</button>
        </div>
        <!-- 按条件选择 -->
        <div class="tab-filter-type ">

            <div class="col-xs-3 padding20">
                <div class="input-group" style="margin-bottom:10PX;">
                    <div class="input-group-btn">
                        <button type="button" style="height: 34px;min-width:80PX" class="btn btn-primary  dropdown-toggle">学期</button>
                    </div>
                    <base-xq :pzoption="query.xq"></base-xq>

                </div>
            </div>
        </div>
        <div class="default-tab ft14  hover-btn" style="overflow-x: inherit;padding:20PX;padding-top:10px">
            <base-table :pzoption="tableop" @selection-change="handleSelectionChange">
            </base-table>
        </div>



        <!-- 表格 -->



    </div>
</template>

<script>
const { debug } = require("console");

    module.exports = {
        props: ['pdata'],
        components: {
            'base-table': httpVueLoader('/ViewV5/Base/Vue/Table.vue'),
            'base-xq': httpVueLoader('/ViewV5/AppPage/QJJW/component/conxq.vue'),
        },
        data: function () {
            return {
                search: "",
                kcdm: "",
           
                query: {
                    zc: "1",
                    xzzt: "0",
                    xq: { value: "" },
                },
                tableop: {
                    title: "班级信息",
                    issel: true,
                    iscz: false,
                    height: 450,
                    isxh: true,
                    dataset: [],
                    loading: true,
                    multipleSelection: [],
                    dtcxdata: [
                        { cxname: "校区", cxzd: "bmmc", cxdata: "", cal: "4", datatype: "1", dtsource: [], val: "" },
                        { cxname: "年级", cxzd: "nj", cxdata: "", cal: "4", datatype: "1", dtsource: [], val: "" },
                        { cxname: "系部", cxzd: "xbmc", cxdata: "", cal: "4", datatype: "1", dtsource: [], val: "" },
                        { cxname: "在校情况", cxzd: "zxqk", cxdata: "", cal: "4", datatype: "1", dtsource: [], val: "在校学习"},

                    ],
                    collist: [
                        { colid: "bmmc", colname: "校区", isshow: true, istip: true },
                        { colid: "xbmc", colname: "系部", isshow: true, istip: true },
                        { colid: "nj", colname: "年级", isshow: true, istip: true },
                        { colid: "bj", colname: "班级", isshow: true, istip: true },
                        { colid: "bh", colname: "班号", isshow: true, istip: true },
                        { colid: "xz", colname: "学制", isshow: true, istip: true },
                        { colid: "zymc", colname: "专业", isshow: true, istip: true },
                        { colid: "zxqk", colname: "在校情况", isshow: true, istip: true },
                        { colid: "bjrs", colname: "班级人数", isshow: true, istip: true  },
                    

                    ]
                }
            }
        },
        methods: {
            handleSelectionChange(val) {
                this.tableop.multipleSelection = val;
            },
          
            dy: function (shzt) {
                var pro = this;
               
                var ids = [];
                for (var i = 0; i < this.tableop.multipleSelection.length; i++) {
                    ids.push(this.tableop.multipleSelection[i].bh);
                }
                if (ids.length == 0) {
                    this.$notify.error({
                        title: '错误',
                        message: '至少需要选择一条数据才能操作'
                    });
                    return;
                }

                var url = "http://jw.yyvtc.cn/web_jcgl/web_jcxy_dy_bjxz_dy.aspx?xq=" + pro.query.xq.value + "&bh=" + ids.join();
                ComFunJS.winviewform(url, "打印", "1000", "", function () {
                });
            },
            querydata: function () {
                var pro = this;
                pro.tableop.loading = true;
                $.getJSON('/API/VIEWAPI.ashx?Action=DATABI_GETVUELISTDATA', { P1: "1,75", P2: "N" }, function (resultData) {
                    if (!resultData.ErrorMsg) {
                        pro.tableop.dataset = resultData.Result2;
                        pro.tableop.loading = false;

                    }
                })

            },

            InitWigetData: function () {
                this.querydata();
            },
        },
        watch: {
            'query': { //深度监听，可监听到对象、数组的变化
                handler(newV, oldV) {
                    var chi = this;
                    if (newV) {
                        chi.querydata();
                    }
                },
                deep: true
            }
        },
        mounted: function () {
            var pro = this;
            pro.$nextTick(function () {
                //pro.InitWigetData();
            })

        }
    };
</script>